var router = require('koa-router')();
var Mock = require('mockjs');
router.prefix('/api');

router.get('/test', function *(next) {
  this.body =Mock.mock({
    // 属性 list 的值是一个数组，其中含有 1 到 10 个元素
    'list|1-10': [{
        // 属性 id 是一个自增数，起始值为 1，每次增 1
        'id|+1': 1
    }]
})
})

router.get('/navigation', function *(next) {
  this.body =Mock.mock({
    'list|6-12': [{
        'v|+1': 0,
         txt: "@ctitle(4)",

    }]
})
})

router.get('/swiperBanner', function *(next) {  
  this.body =[{
                url: "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3394908193,3265716466&fm=26&gp=0.jpg",
                link: "#"
            },
            {
                url: "https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3870762006,3891715105&fm=26&gp=0.jpg",
                link: "#"
            },
            {
                url: "https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2735332641,1754574298&fm=26&gp=0.jpg",
                link: "#"
            },
        ]
})
module.exports = router;
